<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学生选课管理系统</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="stylesheet" href="./static/css/font.css">
    <link rel="stylesheet" href="./static/css/weadmin.css">
    <script src="./lib/layui/layui.js" charset="utf-8"></script>

</head>
<body class="login-bg">

<div class="login">
    <div class="message">学生选课系统登录</div>
    <div id="darkbannerwrap"></div>

    <div class="layui-form">
        <input name="username" placeholder="用户名" type="text" lay-verify="required" class="layui-input">
        <hr class="hr15">
        <input name="password" lay-verify="required" placeholder="密码" type="password" class="layui-input">
        <hr class="hr15">
        <input class="loginin" value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
        <hr class="hr20">
    </div>
</div>
<script src="static/js/common.js" charset="utf-8"></script>

<script type="text/javascript">
    layui.extend({//layui.extend扩展一个模块别名
        admin: '{/}./static/js/admin'
    });
    layui.use(['form', 'admin'], function () {
        var form = layui.form
            , admin = layui.admin;

        var $ = layui.$;
        $('.loginin').click(function () {

            var name = $("input[name='username']").val();
            var password = $("input[name='password']").val();
            $.ajax({
                url: remoteUrl+"index/login?number=" + name + "&password=" + password,
                type: 'post',//method请求方式，get或者post
                dataType: 'json',//预期服务器返回的数据类型
                contentType: "application/json; charset=utf-8",
                success: function (res) {//res为相应体,function为回调函数
                    if (res.status === 200) {
                        layer.msg("登陆成功");
                        sessionStorage.setItem("scs_user", JSON.stringify(res.result));
                        localStorage.setItem("isLogin","login")
                        window.location.href="index.html";
                    } else {
                        layer.msg(res.message);
                    }

                }
            });


        })


    });

</script>
<!-- 底部结束 -->
</body>
</html>